import torch
import os
from model import Net
import torch.nn.functional as F
from Data_preprocessing import Excel_dataset
def ver():
    classes = ("1", "2", "3", "4", "5")

    net = Net()
    net.load_state_dict(torch.load('./Model.pth'))
    net.eval()
    print("请依次输入6个设备数据")
    a = float(input("数据1："))
    b = float(input("数据2："))
    c = float(input("数据3："))
    d = float(input("数据4："))
    e = float(input("数据5："))
    f = float(input("数据6："))
    ls = [a,b,c,d,e,f]
    ls[0] = ls[0] / 5
    ls[1] = ls[1] / 2
    ls[2] = ls[2] / 200
    ls[3] = ls[3] / 2
    ls[4] = ls[4] / 5
    ls[5] = ls[5] / 4
    x = torch.tensor([ls])

    with torch.no_grad():
        output = net(x)
    predict = torch.max(output,dim=1)[1].numpy()[0]
    print("设备重要性等级为：",classes[predict])

if __name__ == "__main__":
    ver()